<template>
    <div class="title">
        <span>{{ txt }}</span>
    </div>
</template>

<script>
export default {
    props: {
        txt: {
            default: '大家都在看'
        }
    }
}
</script>

<style lang="less" scoped>
.title {
    height: 50px;
    line-height: 50px;
    position: relative;
    overflow: hidden;
    background-color: #fff;

    span {
        position: absolute;
        width: 30%;
        background: #fff;
        left: 0;
        top: 0;
        bottom: 0;
        right: 0;
        margin: auto;
        z-index: 2;
        text-align: center;
        font-size: 18px;
    }

    &::after {
        content: "";
        width: 40%;
        height: 2px;
        background: #ccc;
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        z-index: 1;
    }
}
</style>